import request from '@/utils/request.js'

export default {
  // 查询组织架构树
  async getOrgTree(data) {
    return await request({
      url: '/form/FormGroup/tree',
      data: data,
      method: 'POST',
    })
  },

  // 查询系统角色
  async getRole() {
    return await request({
      url: 'oa/org/role',
      method: 'GET',
    })
  },

  // 搜索人员
  async getUserByName(data) {
    return await request({
      url: '/form/FormGroup/user',
      data: data,
      method: 'POST',
    })
  },

  // 查询物料
  async getMaterial(data) {
    return await request({
      url: '/form/FormGroup/material',
      data: data,
      method: 'POST',
    })
  },

  // 查询物料字段
  async getField(data) {
    return await request({
      url: '/form/FormGroup/materialField',
      data: data,
      method: 'POST',
    })
  },

  // 查询仓库
  async getBrand(data) {
    return await request({
      url: '/shop/Product/brand_list',
      data: data,
      method: 'POST',
    })
  },

  // 查询物料库存
  async getStock(data) {
    return await request({
      url: '/form/FormGroup/stock_num',
      data: data,
      method: 'POST',
    })
  },

  // 查询所有审批单模板
  async getForm(data) {
    return await request({
      url: '/form/Form/all_list',
      data: data,
      method: 'POST',
    })
  },

  // 查询审批单分页列表
  async getApply(data) {
    return await request({
      url: '/form/Apply/index',
      data: data,
      header: { 'content-type': 'application/x-www-form-urlencoded' },
      method: 'POST',
    })
  },

  // 查询关联单据回显
  async getDocInfo(data) {
    return await request({
      url: '/index/Api/get_materil_list',
      data: data,
      method: 'POST',
    })
  },

  // 查询收货人
  async getContact(data) {
    return await request({
      url: '/index/Api/contactList',
      data: data,
      method: 'POST',
    })
  },

  // 查询承运人
  async getCarrier(data) {
    return await request({
      url: '/index/Api/cartlist_all',
      data: data,
      method: 'POST',
    })
  },

  // 查询供应商
  async getSupply(data) {
    return await request({
      url: '/index/Api/get_supply',
      data: data,
      method: 'POST',
    })
  },

  // 查询工程项目
  async getProject(data) {
    return await request({
      url: '/index/Api/get_project',
      data: data,
      method: 'POST',
    })
  },

  // 查询合同单
  async getContract(data) {
    return await request({
      url: '/index/Api/get_contract',
      data: data,
      method: 'POST',
    })
  },

  // 查询对比仓库物料信息
  async checkMaterialsByCode(data) {
    return await request({
      url: '/index/Api/check_materials_by_codes',
      data: data,
      method: 'POST',
    })
  },

  // 查询组织
  async getOrganization(data) {
    return await request({
      url: '/index/Api/get_organization',
      data: data,
      method: 'POST',
    })
  },

  // 查询试验区域
  async getTestArea(data) {
    return await request({
      url: '/set/Index/getArea',
      data: data,
      method: 'POST',
    })
  },

  // 查询试验品种
  async getTestBreed(data) {
    return await request({
      url: '/set/Breed/getBreed',
      data: data,
      method: 'POST',
    })
  },

  // 查询生产车间
  async getWorkshop(data) {
    return await request({
      url: '/set/Department/getWorkshop',
      data: data,
      method: 'POST',
    })
  },

  // 新查询供应商
  async OrgBaseDatalist(data) {
    return await request({
      url: '/form/BaseData/list',
      data: data,
      method: 'POST',
    })
  },

  // 查询岗位信息
  async FormGroupTree(data) {
    return await request({
      url: '/form/FormGroup/tree',
      data: data,
      method: 'POST',
    })
  },
  // 查询岗位信息
  async FormGroupuser(data) {
    return await request({
      url: '/form/FormGroup/user',
      data: data,
      method: 'POST',
    })
  },
  // 查询当前信息
  async getCurrentData(data) {
    return await request({
      url: '/form/BaseData/baseList',
      method: 'POST',
      data: data,
    })
  },
}
